﻿using Collection.Entities;
using Super.Collection.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Itfort;
namespace Super.Collection.Services
{
    public class LotteryNumberService : ServiceBase, ILotteryNumberService
    {
        /// <summary>
        /// 插入开奖号码信息
        /// </summary>
        public void Insert(LotteryNumber lotteryNumbers)
        {
            this.DbSession.Save<_LotteryNumber>(lotteryNumbers.Convert2<_LotteryNumber>());
        }

        /// <summary>
        /// 根据公告编号和号码位置号码信息
        /// </summary>
        /// <param name="briefingId">公告编号</param>
        /// <param name="location">号码位置</param>
        /// <returns>中奖号码</returns>
        public LotteryNumber Get(long briefingId, short location)
        {
            return this.DbSession.Single<_LotteryNumber>(_LotteryNumber._.BriefingId == briefingId
                             && _LotteryNumber._.Location == location)
                     .Convert2<LotteryNumber>();
        }
    }
}
